package com.lening.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.community.dto.ShopsDto;

import com.lening.community.pojo.House;
import com.lening.community.pojo.Shops;
import com.lening.community.vo.HouseVo;
import com.lening.community.vo.ShopsVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ToDo:
 * @Author：潘万法
 * @date: 2024/6/3 16:55
 */
public interface ShopsMapper extends BaseMapper<Shops> {
    Page<Shops> page(ShopsDto shopsDto);

    /**
     * 导入
     *
     * @return
     */
    @Select("select * from shops")
    List<Shops> find();
    @Insert("INSERT into shops(sid,community_id,shop_area_id,shop_num,flooring,build_area,use_area,type_id,house_statu_id," +
            "delete_id,yid,remarks) VALUES(#{sid},#{communityId},#{shopAreaId},#{shopNum},#{flooring},#{buildArea},#{useArea},#{typeId},#{houseStatuId}," +
            "#{deleteId},#{yid},#{remarks})")
    int insert(House house);


    /**
     * 详情
     * @param sid
     * @return
     */
    ShopsVo getById(Long sid);

    /**
     * 查询商铺数量
     * @return
     */
    int getCount();
}
